<#include "/macro.include"/>
<#include "/custom.include">
<#assign className = table.className>   
<#assign classNameLower = className?uncap_first>
package com.github.wxiaoqi.security.checkout.service;

import java.util.List;
import java.util.Map;

import com.github.wxiaoqi.security.checkout.model.${className}Model;
import com.github.wxiaoqi.security.checkout.common.utils.util.PageList;
<#--import ${basePackage}.dataobject.${className}DO;-->
<#--import ${basePackage}.vo.${table.sqlName?split("_")[1]}.Query${className}Vo;-->

/**
* 类名: ${className}Service
* @author wjt
*/
public interface ${className}Service {
	
    /**
     * 根据ID获取记录
     * @param id id
     * @return ${className}Model 对象
     */
    ${className}Model findById(<#list table.columns as column><#if column.pk><#if column.javaType == "java.lang.Long">Long id</#if><#elseif column.javaType == "java.lang.Integer">Integer id<#else></#if></#list>);

    /**
     * 保存记录
     * @param ${className?uncap_first}Model 对象
     * @return int 保存数量
     */
    Map save(${className}Model ${className?uncap_first}Model);

    /**
     * 根据ID删除记录
     * @param id id
     * @return int 删除数量
     */
    int delete(<#list table.columns as column><#if column.pk><#if column.javaType == "java.lang.Long">Long id</#if><#elseif column.javaType == "java.lang.Integer">Integer id<#else></#if></#list>);

    /**
    * 多条件组合查询
    * @param ${className?uncap_first}Model 对象
    * @return List<${className}Model> 对象列表
    */
    List<${className}Model> listByParams(${className}Model ${className?uncap_first}Model);

    /**
    * 分页查询
    * @param ${className?uncap_first}Model 对象
    * @param pageIndex 当前页
    * @param pageSize 每页记录数量
    * @return PageList<${className}Model> 分页信息
    */
    PageList<${className}Model> pageListByParams(${className}Model ${className?uncap_first}Model, int pageIndex, int pageSize);

}